package cn.kgm.filterVip;

import java.util.ArrayList;
import java.util.List;

/**
 * 过滤器demo，用于过滤用户是否具备多角色
 */
public class IdentityFilterDemo {
    public static void main(String[] args) {
        List<IdentityFilter> ids = new ArrayList<>();
        ids.add(new VipIdentityFilter());
        ids.add(new BlackGloadIdentityFilter());


        List<IdentityFilter> calcs = new ArrayList<>();
        Person person = Person.builder()
                .blackGload(true)
                .vip(true)
                .superVip(false)
                .build();

        calcs.add(new SuperVipFilter());
        calcs.add(AndIdentityFilter.doAndIdentityFilter(ids, person));

        System.out.println(OrIdentityFilter.doOrIdentityFilter(calcs, person));

    }
}
